/**
 * 音乐接口请求方法
 *
 */
import {MusicInsertDTO, MusicPageDTO} from "../interface/MusicInterface";
import projectRequest from "./request";


/** 多条件 */
export function getMusicByPageAPI(params:MusicPageDTO) {
  return projectRequest.request({
    method:"get",
    url:"/music/page",
    params
  });
}

export function insertMusicAPI(data:MusicInsertDTO) {
  return projectRequest.request({
    method:"post",
    url:"/music/insert",
    data,
  });
}

//根据id返回歌曲详情
export function getMusicByIdAPI(musicId:number) {
  return projectRequest.request({
    method:"get",
    url:`/music/${musicId}`,
  });
}

/**
 * @description 根据ids返回歌曲详情列表
 * 注意：这个查询主要是在音乐播放页中使用的
 * @param ids
 */
export function getMusicByIdsApi(ids?:string) {
  return projectRequest.request({
    method:"post",
    url:"/music/ids",
    data:{ids}
  });
}
